<!--
*@Author: QWP
*@Description: 发文相关待办
*@Date: 2024-07-14 17:26:27
-->
<template>
  <u-card class="f-h-100">
    <a-tabs v-model:activeKey="activeKey">
      <a-tab-pane key="1" tab="待处理收文">
        <u-table :columns="dispatchDocCols" :data="stayDealWithDatas" :pagination="false"
          :scroll="{ y: 300 }"></u-table>
      </a-tab-pane>
      <a-tab-pane key="2" tab="已处理收文">
        <u-table :columns="dispatchDocCols" :data="stayDealWithedDatas" :pagination="false"
          :scroll="{ y: 300 }"></u-table>
      </a-tab-pane>
      <a-tab-pane key="3" tab="收取的公文">
        <u-table :columns="dispatchDocCols" :data="initiateDocDatas" :pagination="false"
          :scroll="{ y: 300 }"></u-table>
      </a-tab-pane>
    </a-tabs>
  </u-card>
</template>

<script lang='ts' setup>
import { ref, reactive, computed, onMounted, h } from 'vue' 

import { useRoute, useRouter } from 'vue-router'
import { ColProps, FormItemProps, TableColumnProps, Button } from "ant-design-vue";
import dayjs from 'dayjs';

const activeKey = ref('1');

onMounted(() => {
  for(let i = 0; i < 8; i++) {
    stayDealWithDatas.push({
      a: '待处理收文标题' + (i + 1), b: '丁艳玲', c: dayjs().format("YYYY-MM-DD")
    })
    stayDealWithedDatas.push({
      a: '已处理收文标题' + (i + 1), b: '马权', c: dayjs().format("YYYY-MM-DD")
    })
    initiateDocDatas.push({
      a: '收的公文标题' + (i + 1), b: '刘亦菲', c: dayjs().format("YYYY-MM-DD")
    })
  }
})

// 待处理收文列表
const stayDealWithDatas = reactive([]);

// 已处理收文列表
const stayDealWithedDatas = reactive([]);

// 发起的公文列表
const initiateDocDatas = reactive([]);
let dispatchDocCols: Array<TableColumnProps> = reactive([
  { dataIndex: "a", title: "公文标题", minWidth: 100 },
  { dataIndex: "b", title: "拟稿人", width: 100 },
  { dataIndex: "c", title: "拟稿时间", width: 100, align: 'center' },
  { dataIndex: "d", title: "操作", width: 100,
    customRender: ({ text, record }) => {
      return h(Button, { type: 'link' }, "去处理")
    }
  },
]);



</script>

<style lang='scss' scoped>
</style>